<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<jsp:include page="header.jsp" />
	<form action="recommend" method="post">
		<table>
			<tr>
				<td>Enter your city:</td>
				<td><input type="text" name="city" /></td>
				<td><input type="submit" value="Get Recommendation" /></td>
				<c:if test="${not empty degree }">
					<td>${degree } C</td>
				</c:if>
			</tr>
		</table>
	</form>
	<c:choose>
		<c:when test="${not empty movie}">
			<table border="1">
				<tr bgcolor="#9acd32">
					<th>Name</th>
					<th>Director</th>
					<th>Year</th>
					<th>Genre</th>
					<th>Rent</th>
				</tr>
				<tr>
					<td><c:out value="${movie.name}" /></td>
					<td><c:out value="${movie.director}" /></td>
					<td><c:out value="${movie.year}" /></td>
					<td><c:out value="${movie.genre}" /></td>
					<td><a href="rent?id=${movie.id}">Rent</a></td>
				</tr>
			</table>
		</c:when>
		<c:otherwise>
			<c:choose>
				<c:when test="${empty error}">
					<c:if test="${not empty recommend }">
				No recommendation found. Go to <a href="">catalog</a>
					</c:if>
				</c:when>
				<c:otherwise>
				${error}
			</c:otherwise>
			</c:choose>
		</c:otherwise>
	</c:choose>
</body>
</html>